import os
import re

# 检测网络连接
def isConnection():
    hasConnection = os.system('ping www.baidu.com')
    if hasConnection:
        return False
    else:
        return True

def hasContent(findContent, content):
    '''
    :param findContent: r'\"raw_title\":\".*?\"'
    :param content:
    :return: 
    '''
    re.findall(findContent, content)

# 字符串判空
def isEmpty(content):
    if content:
        return True
    else:
        return False

def notEmpty(content):
    if not(content):
        return True
    else:
        return False